/**
 * Moondance UML modeling tool
 * 
 * @author Dascalu Laurentiu (dascalu.laurentziu@gmail.com).
 * 
 * This program is free software; you can redistribute it and
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package ro.pub.cs.se.moondance.xmi.converter;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class UMLDirectAssociationConnectionXMI extends UMLAssociationConnectionXMI {

	public UMLDirectAssociationConnectionXMI(String name, String id, String source,
			String destination, String sourceLabel, String destinationLabel) {
		super(name, id, source, destination, sourceLabel, destinationLabel);
	}
	
	/**
	 * Example for DIRECT ASSOCIATION
	 * <packagedElement
	 * xmi:type="uml:Association"
	 * xmi:id="_fp34sGcgEd6eLuBoYJyKmQ"
	 * name="LabelOnAssociationConnection"
	 * direction="true"
	 * memberEnd="_fp34tGcgEd6eLuBoYJyKmQ _fp34sWcgEd6eLuBoYJyKmQ">
	 *     <ownedEnd
	 *         xmi:id="_fp34sWcgEd6eLuBoYJyKmQ"
	 *         name="src"
	 *         type="_axGL4GcgEd6eLuBoYJyKmQ" "Left" END (source)
	 *         association="_fp34sGcgEd6eLuBoYJyKmQ"/>
	 *     <ownedEnd
	 *         xmi:id="_fp34tGcgEd6eLuBoYJyKmQ"
	 *         name="dst"
	 *         type="_4xhvEGcfEd6eLuBoYJyKmQ" "Right" END (destination)
	 *         association="_fp34sGcgEd6eLuBoYJyKmQ"/>
	 * </packagedElement>
	 */

	@Override
	public void serialize(Element root, Document document) {
		super.serialize(root, document);
		if (root.getLastChild() instanceof Element) {
			//Element el = (Element) root.getLastChild();
			//TODO: add additional attributes; looks like EMF.XMI plugin
			// knows nothing about directed association
			//el.setAttribute(XMICommon.DIRECTION, "true");
		}
	}
}
